const { defineConfig } = require('@vue/cli-service')

// 自动导入插件
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')


module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave:false,

  devServer:{
      host: 'localhost', 
      port: 8080, 
      open: true,
      
      proxy:{
          '/api':{
              target: 'http://localhost:8080/',
              changeOrigin:true,
              pathRewrite: {
                '^/api': ''
              }
          }
      }
  },

  configureWebpack:{
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()],
      }),
      Components({
        resolvers: [ElementPlusResolver()],
      }),
    ],
  }
  
})
